{% extends 'layout.html' %}

{% block content %}
    <div class="container">
        <div style="margin-bottom: 10px">  {#  按钮"新建部门"和面板表添加10像素的距离  #}
            <a class="btn btn-success" href="/tools/user/add/" target="_blank">
                <span class="glyphicon glyphicon-plus-sign" aria-hidden="true"></span>
                新增用户
            </a>

            <a class="btn btn-success" href="/tools/user/model/form/add/" target="_blank">
                <span class="glyphicon glyphicon-plus-sign" aria-hidden="true"></span>
                新增用户ModelForm
            </a>
        </div>

        <div class="panel panel-default">
          <!-- Default panel contents -->
          <div class="panel-heading">
              <span class="glyphicon glyphicon-list" aria-hidden="true"></span>
              用户列表
          </div>

          <!-- Table -->
          <table class="table table-bordered">  {#  table-bordered 边框  #}
            <thead>
                <tr>
                    <th>ID</th>
                    <th>姓名</th>
                    <th>密码</th>
                    <th>年龄</th>
                    <th>余额</th>
                    <th>创建时间</th>
                    <th>性别</th>
                    <th>部门</th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody>
            {% for obj in querySet %}
            	<tr>
                    <th >{{ obj.id }}</th>
                    <td>{{ obj.name }}</td>
                    <td>{{ obj.password }}</td>
                    <td>{{ obj.age }}</td>
                    <td>{{ obj.account }}</td>
                    <td>{{ obj.creatime }}</td>
                    <td>{{ obj.get_gender_display }}</td>
                    <td>{{ obj.depart.title }}</td>
                    <td>
                        <a class="btn btn-primary btn-xs" href="/tools/user/{{ obj.id }}/edit/">编辑</a>
                        <a class="btn btn-danger btn-xs" href="/tools/user/{{ obj.id }}/delete/">删除</a>
                    </td>
                </tr>
            {% endfor %}

            </tbody>
          </table>
        </div>
        <ul class="pagination">
            {{ page_string }}
        </ul>
    </div>

{% endblock %}


{% comment %}
{% load static %}

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="{% static 'plugins/bootstrap-4.6.2/dist/css/bootstrap.css' %}">
{#    <link rel="stylesheet" href="{% static 'plugins/bootstrap-3.4.1/dist/css/bootstrap.css' %}">#}
</head>
<body>
<h1>用户列表！</h1>
<input type="text" class="btn btn-primary" value="新增">

{#<img src="/static/img/大眼睛4.gif">#}       <!-- 不推荐 -->
<img src="{% static 'img/大眼睛4.gif' %}">    <!-- 推  荐 -->

<script src="{% static 'js/jquery-3.7.1/jquery-3.7.1.min.js' %}"></script>
{#<script src="{% static 'js/jquery-3.6.0/jquery-3.6.0.min.js' %}"></script>#}
<script src="{% static 'plugins/bootstrap-4.6.2/dist/js/bootstrap.js' %}"></script>
{#<script src="{% static 'plugins/bootstrap-3.4.1/dist/js/bootstrap.js' %}"></script>#}
</body>
</html>{% endcomment %}
